from pydantic import BaseModel
from typing import List, Optional, Any
from typing import TypeVar, Generic

# 定义一个类型变量
Ty = TypeVar("Ty")

# 通用API响应
class Api(BaseModel, Generic[Ty]):
    code: int
    data: Ty

# 分页响应
class Paginated(BaseModel, Generic[Ty]):
    total_page: int
    current_page: int
    has_next: bool
    data: List[Ty]
